package nc.itf.single.pub;

import java.text.SimpleDateFormat;
import java.util.Date;

import nc.bs.framework.common.NCLocator;
import nc.vo.pub.BusinessException;
import nc.vo.pub.log.LogVO;

public class LogUtil {
	
	private final static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");

	public final static String insert(LogVO vo) {
		
		try {
			vo.setDr(0);
			vo.setCreatedate(sdf.format(new Date()));
			return NCLocator.getInstance().lookup(IPrivateUtilMaintain.class).executeInsert__RequiresNew(vo);
		} catch (BusinessException e) {
			e.printStackTrace();
		}
		
		return null;
	}
	
	public final static int update(LogVO vo) {
		
		try {
			return NCLocator.getInstance().lookup(IPrivateUtilMaintain.class).executeUpdate__RequiresNew(vo);
		} catch (BusinessException e) {
			e.printStackTrace();
		}
		
		return 0;
	}
	
}
